package com.hww.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hww.entity.TableType;
import com.hww.service.Impl.TableTypeImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.server.PathParam;

@RestController
public class TableTypeController {
  @Autowired private TableTypeImpl tableType;

  @RequestMapping("/initializeData")
  public IPage<TableType> initializeData(@PathParam("pages") Long pages) {

    if (pages == null || pages == 0) {
      pages = 1L;
    }
    IPage<TableType> tableTypeIPage = tableType.initializeData(pages);
    return tableTypeIPage;
  }
}
